<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="经办人" prop="empId">
        <!-- <el-input
          v-model="queryParams.empId"
          placeholder="请输入经办人"
          clearable
          @keyup.enter.native="handleQuery"
        /> -->
        <el-select v-model="queryParams.empId" placeholder="请选择经办人姓名">
              <el-option
                v-for="item in optionsAudit"
                :key="item.empId"
                :label="item.empName"
                :value="item.empId">
              </el-option>
          </el-select>
      </el-form-item>

      <!-- <el-form-item label="签约人" prop="signatory">
        <el-input
          v-model="queryParams.signatory"
          placeholder="请输入签约人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item label="合同类型" prop="contractId">
        <!-- <el-input
          v-model="queryParams.contractId"
          placeholder="请输入合同类型名称"
          clearable
          @keyup.enter.native="handleQuery"
        /> -->
         <el-select v-model="queryParams.contractId" placeholder="请选择合同类型名称" clearable
          @keyup.enter.native="handleQuery">
              <el-option
                 v-for="item in optionscontract"
                 :key="item.contractId"
                :label="item.contractName"
                :value="item.contractId">
              </el-option>
            </el-select>
      </el-form-item>
      <el-form-item label="结算类型" prop="settlement">
        <el-select v-model="queryParams.settlement" placeholder="请选择结算类型" clearable
          @keyup.enter.native="handleQuery">
              <el-option
                 v-for="item in settlements"
                 :key="item.settlement"
                :label="item.settlementName"
                :value="item.settlement">
              </el-option>
            </el-select>

      </el-form-item>
      <el-form-item label="签约公司" prop="contractCompany">
        <el-input
          v-model="queryParams.contractCompany"
          
          placeholder="请输入签约公司"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      </el-form-item>
      
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="small" round @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="small" round @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="small" round
          @click="handleAdd"
          v-hasPermi="['document:contract:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"

          icon="el-icon-edit"
          size="small" round
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['document:contract:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"

          icon="el-icon-delete"
          size="small" round
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['document:contract:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          icon="el-icon-download"
         size="small" round
          @click="handleExport"
          v-hasPermi="['document:contract:export']"
        >导出</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          icon="el-icon-refresh-right"
          size="small" round
          @click="handleRollback"
          v-hasPermi="['personnel:employee:export']"
        >回滾</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="contractList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <!-- <el-table-column label="合同编号" align="center" prop="conId" /> -->
      <el-table-column label="经办人" align="center" prop="empName" />
      <el-table-column label="签约人" align="center" prop="signatory" />
      <el-table-column label="合同金额(元)" align="center" prop="amount" />
      <el-table-column label="币种名称" align="center" prop="currencyName" />
      <el-table-column label="结算类型" align="center" prop="settlement" >
        <template slot-scope="scope">
          <span>{{scope.row.settlement==0?'未收款':''}}</span>
          <span>{{scope.row.settlement==1?'收款':''}}</span>
        </template>
      </el-table-column>
      <el-table-column label="合同起草时间" align="center" prop="contractTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.contractTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="截至时间" align="center" prop="isBlack" width="180" sortable>
        <!-- <template slot-scope="scope">
          <span>{{ parseTime(scope.row.effectiveTime, '{y}-{m}-{d}') }}</span>
        </template> -->
        <template slot-scope="scope">
          <!-- <span>{{ parseTime(scope.row.effectiveTime, '{y}-{m}-{d}') }}</span> -->
          {{scope.row.effectiveTime==null?'长期有效':scope.row.effectiveTime}}<br>
           <el-tag type="danger" v-if="scope.row.isBlack != '已逾期0天' && scope.row.isBlack != null ">{{scope.row.isBlack}}</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="审核状态" align="center" prop="state">
          <template slot-scope="scope">
          <!-- <span>{{scope.row.state==0?'未审核':''}}</span>
           <span>{{scope.row.state==1?'审核中':''}}</span>
            <span>{{scope.row.state==2?'审核通过':''}}</span>
             <span>{{scope.row.state==3?'审核未通过':''}}</span> -->
          <el-tag  v-if="scope.row.state == 0">未审核</el-tag>
          <el-tag type="warning"  v-if="scope.row.state == 1">审核中</el-tag>
          <el-tag type="success" v-if="scope.row.state == 2">审核通过</el-tag>
          <el-tag  type="danger" v-if="scope.row.state == 3">审核未通过</el-tag>
        </template>
      </el-table-column>
      <!-- <el-table-column label="版本号" align="center" prop="version" /> -->
      <el-table-column label="合同类型名称" align="center" prop="contractName" />
      <el-table-column label="签约公司" align="center" prop="contractCompany" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="small" round
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['document:contract:edit']"
          >修改</el-button>
          <el-button
           size="small" round
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['document:contract:remove']"
          >删除</el-button>
          <!-- <el-button
            size="mini"
            type="text"
            icon="el-icon-s-order"
            @click="handleState(scope.row)"
             v-hasPermi="['document:contract:add']"
          >申批</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handleDetails(scope.row)"
            v-hasPermi="['document:contract:edit']"
          >合同详情</el-button> -->
        <!-- 更多 -->

                      <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['document:contract:add', 'images:downloadShowFastDFS','images:downloadFastDFS']">
                <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
                <el-dropdown-menu slot="dropdown">

<el-dropdown-item
            size="mini"
            type="text"
            icon="el-icon-s-order"
           command="handleState"
             v-hasPermi="['document:contract:add']"
          >申批</el-dropdown-item>
                  <el-dropdown-item
                    v-show="scope.row.fileType == 'jpg'"
                    size="mini"
                    type="text"
                    icon="el-icon-view"
                    command="handleDetails"
                    v-hasPermi="['image:downloadShow']"
                  >预览</el-dropdown-item>
                  <el-dropdown-item
                    v-show="scope.row.groupName != null"
                    size="mini"
                    type="text"
                    icon="el-icon-view"
                    command="downloadImage"
                    v-hasPermi="['image:download']"
                  >下载</el-dropdown-item>


                </el-dropdown-menu>
              </el-dropdown>

      </template>
    </el-table-column>
  </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改合同签约管理对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="850px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <table>

           <tr>
             <td class="tttt">
 <el-form-item label="选择合同" :label-width="formLabelWidth">

          <el-upload
            class="upload-demo"
            drag
            action="http://localhost:8080/image/uploadText/"
            :on-success="handle_success"
            multiple>
            <i class="el-icon-upload"></i>
            <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
            <div class="el-upload__tip" slot="tip">只能上传jpg/png文件，且不超过500kb</div>
          </el-upload>
        </el-form-item>

             </td>
           </tr>
            <tr>
                <td class="my">
 <el-form-item label="经办人" prop="empId">
          <!-- <el-input v-model="form.operator" placeholder="请输入经办人" /> -->
          <el-select v-model="form.empId"  :disabled="verification"  placeholder="请选择经办人姓名">
              <el-option
                v-for="item in optionsAudit"
                :key="item.empId"
                :label="item.empName"
                :value="item.empId">
              </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="签约人" prop="signatory">
          <el-input v-model="form.signatory" :disabled="verification" placeholder="请输入签约人" />
        </el-form-item>
        <el-form-item label="合同金额" prop="amount">
          <el-input v-model.number="form.amount" placeholder="请输入合同金额"  />
        </el-form-item>
        <el-form-item label="币种名称" prop="currencyId">
          <!-- <el-input v-model="form.currencyId" placeholder="请输入币种id" /> -->
          <el-select v-model="form.currencyId" placeholder="请选择币种名称">
    <el-option
      v-for="item in options"
      :key="item.currencyId"
      :label="item.currencyName"
      :value="item.currencyId">
    </el-option>
  </el-select>
        </el-form-item>

                </td>
                <td>

<el-form-item label="起草时间" prop="contractTime">
          <!-- <el-date-picker clearable
            v-model="form.contractTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择合同起草时间">
          </el-date-picker> -->
           <el-date-picker
      v-model="form.contractTime"
     :disabled="verification"
      align="right"
      type="date"
      value-format="yyyy-MM-dd"
      placeholder="选择日期"
      :picker-options="pickerOptions">
    </el-date-picker>
    </el-form-item>
        <el-form-item label="结算类型"  prop="settlement">
          <!-- <el-input v-model="form.settlement" placeholder="请输入结算类型" /> -->
          <template>
            <el-radio v-model="form.settlement" label="1">收款</el-radio>
            <el-radio v-model="form.settlement" label="0">未收款</el-radio>
          </template>
        </el-form-item>




        <el-form-item label="截至时间" prop="effectiveTime">
          <el-date-picker clearable
            v-model="form.effectiveTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择截至时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="合同类型" prop="contractId">
          <!-- <el-input v-model="form.contractId" placeholder="请输入合同类型名称" /> -->
           <el-select v-model="form.contractId" placeholder="请选择合同类型名称">
              <el-option
                 v-for="item in optionscontract"
                 :key="item.contractId"
                :label="item.contractName"
                :value="item.contractId">
              </el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="签约公司" prop="contractCompany">
          <el-input v-model="form.contractCompany" placeholder="请输入签约公司" />
        </el-form-item>

                </td>
            </tr>





         </table>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" size="small" round @click="submitForm">确 定</el-button>
        <el-button size="small" round @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 添加或修改审批管理对话框 -->
    <el-dialog :title="titleState" :visible.sync="openState" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <!-- <el-form-item label="申请时间" prop="newtime">
          <el-date-picker clearable
            v-model="form.newtime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择申请时间">
          </el-date-picker>
        </el-form-item> -->
        <el-form-item label="申请人" prop="empId">
          <!-- <el-input v-model="form.empName" placeholder="请输入申请人" /> -->
           <el-select v-model="form.empId" placeholder="请选择申请人姓名">
              <el-option
                v-for="item in optionsAudit"
                :key="item.empId"
                :label="item.empName"
                :value="item.empId">
              </el-option>
          </el-select>
        </el-form-item>
        <!-- <el-form-item label="(删除)状态:默认0(0:存在,1:删除)" prop="version">
          <el-input v-model="form.version" placeholder="请输入(删除)状态:默认0(0:存在,1:删除)" />
        </el-form-item> -->
        <el-form-item label="申请类别" prop="applyforType">
          <!-- <el-input v-model="form.applyforType" placeholder="请输入申请类别" /> -->
          <template>
            <el-radio v-model="form.applyforType" label="合同申请">合同申请</el-radio>
            <el-radio v-model="form.applyforType" label="其他申请">其他申请</el-radio>
          </template>
        </el-form-item>
        <el-form-item label="审批内容" prop="content">
          <!-- <editor v-model="form.content" :min-height="192"/> -->
          <el-input type="textarea" v-model="form.content"></el-input>
        </el-form-item>
        <!-- <el-form-item label="签字" prop="signature">
          <el-input v-model="form.signature" placeholder="请输入签字" />
        </el-form-item> -->
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFormState">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  listContract,
  getContract,
  delContract,
  addContract,
  updateContract,
  rollback,
  updateContractById,
  getShowFile,
  downloadImage
} from "@/api/document/contract";
import { selectCurrencyData } from "@/api/document/currency";
import { selectContractData } from "@/api/document/type";
import { listEmployee } from "@/api/personnel/employee";
import { addApprove, updateApprove } from "@/api/audit/approve";
import { log } from "util";
export default {
  name: "Contract",
  data() {
    return {
      //查询结算类型下拉框
      settlements: [
        { settlement: 0, settlementName: "未收款" },
        { settlement: 1, settlementName: "收款" },
      ],
     verification:false,
      //时间禁用
      pickerOptions: {
          disabledDate(time) {
            return time.getTime() > Date.now();
          }
          },
      formLabelWidth: "80px",
      options: [],
      optionscontract: [],
      optionsAudit: [],
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 合同签约管理表格数据
      contractList: [],
      // 弹出层标题
      title: "",
      titleState: "",
      // 是否显示,弹出层
      open: false,
      openState: false,
      //审核
      remark: "",
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        operator: null,
        signatory: null,
        amount: null,
        currencyId: null,
        settlement: null,
        contractTime: null,
        effectiveTime: null,
        version: null,
        contractId: null,
        contractCompany: null,
        effectiveTime:null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        operator: [
          { required: true, message: "经办人不能为空", trigger: "blur" }
        ],
        signatory: [
          { required: true, message: "签约人不能为空", trigger: "blur" },
          {
            validator: function(rule, value, callback) {
              //校验中文的正则：/^[\u4e00-\u9fa5]{0,}$/
              // ^[a-zA-Z\u4e00-\u9fa5]+$
              if (/^[a-zA-Z\u4e00-\u9fa5]+$/.test(value) == false) {
                callback(new Error("请输入中文或英文"));
              } else {
                //校验通过
                callback();
              }
            },
            trigger: "change"
          }
        ],
        contractCompany: [
          { required: true, message: "签约公司不能为空", trigger: "blur" },
          {
            validator: function(rule, value, callback) {
              //校验中文的正则：/^[\u4e00-\u9fa5]{0,}$/
              // ^[a-zA-Z\u4e00-\u9fa5]+$
              if (/^[a-zA-Z\u4e00-\u9fa5]+$/.test(value) == false) {
                callback(new Error("请输入中文或英文"));
              } else {
                //校验通过
                callback();
              }
            },
            trigger: "change"
          }
        ],
        empId: [{ required: true, message: "申请人不能为空", trigger: "blur" }],
        settlement: [
          { required: true, message: "结算类型不能为空", trigger: "blur" }
        ],
        contractId: [
          { required: true, message: "合同不能为空", trigger: "blur" }
        ],
        contractTime: [
          { required: true, message: "合同起草时间不能为空", trigger: "blur" }
        ],
        amount: [{ type: "number", message: "合同金额必须为数字" },
    { pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/, message: '请输入正确额格式' },
        ],
        applyforType: [
          { required: true, message: "申请类别不能为空", trigger: "blur" }
        ],
        content: [{ required: true, message: "内容不能为空", trigger: "blur" }]
      }
    };
  },
  created() {
    this.listEmployee();
    this.getList();
    this.selectCurrencyData();
    this.selectContractData();
  },
  methods: {
    downloadImage(row){
      window.open(
        'http://localhost:8080/image/downloadFastDFS/'+row.conId)
    },
    handleDetails(row){
      // window.open(getShowFile(row.conId))
      window.open(
        'http://localhost:8080/image/downloadShowFastDFS/'+row.conId
      )
    },
    /** 获取所有员工名称 */
    listEmployee() {
      this.loading = true;
      listEmployee().then(response => {
        this.optionsAudit = response.rows;
      });
    },
    // 图片加载到本地获取到返回的名称给到from表单数据
    handle_success(res) {
      this.form.groupName = res.groupName;
      this.form.fileName = res.fileName;
      this.form.fileSize = res.fileSize;
      this.form.fileType = res.fileType;
      this.form.oldFileName = res.oldFileName;
    },
    /** 获取所有合同名称 */
    selectContractData() {
      this.loading = true;
      selectContractData().then(response => {
        this.optionscontract = response.rows;
      });
    },
    /** 获取所有币种名称 */
    selectCurrencyData() {
      this.loading = true;
      selectCurrencyData().then(response => {
        this.options = response.rows;
      });
    },
    /** 查询合同签约管理列表 */
    getList() {
      this.loading = true;
      listContract(this.queryParams).then(response => {
        this.contractList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.openState = false;
      this.reset();
    },

    // 表单重置
    reset() {
      this.form = {
        conId: null,
        operator: null,
        signatory: null,
        amount: null,
        currencyId: null,
        settlement: null,
        contractTime: null,
        effectiveTime: null,
        createTime: null,
        updateTime: null,
        version: null,
        contractId: null,
        contractCompany: null,
        fileUpload: null,
        state: null,
        empId: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    // 更多操作触发
    handleCommand(command, row) {
      switch (command) {
        case "handleState":
          this.handleState(row);
          break;
        case "handleDetails":
          this.handleDetails(row);
          break;
        case "downloadImage":
          this.downloadImage(row);
          break;
        default:
          break;
      }
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.conId);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.verification=false;
      this.reset();
      // this.selectCurrencyData();
      this.open = true;
      this.title = "添加合同签约管理";
    },
    /**申批按钮操作 */
    handleState(row) {
      if (row.state == 1) {
        this.$modal.confirm("已在审核中");
      } else if (row.state == 2) {
        this.$modal.confirm("审核已通过");
      } else {
        //表单重置
        this.reset();
        //修改弹窗
        //this.stateOpen = true;
        //this.title = "添加申请管理";
        const conId = row.conId || this.ids;
        getContract(conId).then(response => {
           this.remark = "contract/" + row.conId;
           this.form = response.data;
          
          this.form.empId = null
          this.openState = true;
          this.titleState = "添加申请管理";
        });
      }
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
        this.verification=true;
      this.reset();
      // this.selectCurrencyData();
      const conId = row.conId || this.ids;
      getContract(conId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改合同签约管理";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.conId != null) {
            updateContract(this.form).then(response => {
              if (response) {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.getList();
              } else {
                this.$modal.msgError(
                  "截至时间必须大于起草时间"
                );
              }
            });
          } else {
            addContract(this.form).then(response => {
              if (response) {
                this.$modal.msgSuccess("新增成功");
                this.open = false;
                this.getList();
              } else {
                this.$modal.msgError(
                  "截至时间必须大于起草时间"
                );
              }
            });
          }
        }
      });
    },
    /** 审核提交按钮 */
    submitFormState() {
      this.form.remark = this.remark;
      this.form.state = 1;
      console.log(this.form.conId);
      this.$refs["form"].validate(valid => {
        if (valid) {
          //验证数据不为空操作
          addApprove(this.form).then(response => {
            this.$modal.msgSuccess("发生审批成功");
            this.openState = false;
          });

          updateContractById(this.form.conId).then(response => {
            this.openState = false;
            this.getList();
          });
        }
      });
    },
    /** 删除按钮操作 */
    // handleDelete(row) {
    //   const conIds = row.conId || this.ids;
    //   this.$modal.confirm('是否确认删除合同签约管理编号为"' + conIds + '"的数据项？').then(function() {
    //     return delContract(conIds);
    //   }).then(() => {
    //     this.getList();
    //     this.$modal.msgSuccess("删除成功");
    //   }).catch(() => {});
    // },

    handleDelete(row) {
      const conIds = row.conId || this.ids;
      this.$modal
        .confirm('是否确认删除请假管理编号为"' + conIds + '"的数据项？')
        .then(function() {
          //let axiosPromise = delVacate(abIds);
          //是否删除逻辑
          //return delVacate(abIds);
        })
        .then(() => {
          let res = delContract(conIds);
          res.then(res => {
            // if (res) {
            //   this.getList();
            //   this.$modal.msgSuccess("删除成功");
            // } else {
            //   this.$modal.msgError("未达到结束时间，删除失败");
            // }
            if(row.settlement==0){
            this.$modal.msgError("结算处于未收款，删除失败");
          }else{
          let res = delProgramme(proIds);
             res.then((res)=>{
          if (res){
            this.getList();
            this.$modal.msgSuccess("删除成功");
          } else {
            this.$modal.msgError("未达到结束时间，删除失败");
          }
        })
          }
          });
        })
        .catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download(
        "document/contract/export",
        {
          ...this.queryParams
        },
        `contract_${new Date().getTime()}.xlsx`
      );
    },
    /**回滚操作 */
    handleRollback() {
      rollback().then(res => {
        if (!res) {
          this.$message({
            message: "目前不存在撤销功能",
            type: "warning"
          });
        } else {
          this.$message({
            message: "回滚成功",
            type: "success"
          });
          this.getList();
        }
      });
    }
  }
};
</script>

<style>
.tttt{
  position: relative;
  left: 160px;
}
.my{
   position: absolute;
   top: 370px;
}

</style>
